package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.hires.entity.ResumeTrainingDO;
import cn.iocoder.yudao.hires.vo.ResumeTrainingPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 简历-培训经历 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ResumeTrainingMapper extends BaseMapperX<ResumeTrainingDO> {

    default PageResult<ResumeTrainingDO> selectPage(ResumeTrainingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResumeTrainingDO>()
                .eqIfPresent(ResumeTrainingDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ResumeTrainingDO::getTrainingInstitutions, reqVO.getTrainingInstitutions())
                .eqIfPresent(ResumeTrainingDO::getTrainingDirection, reqVO.getTrainingDirection())
                .betweenIfPresent(ResumeTrainingDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(ResumeTrainingDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(ResumeTrainingDO::getTrainingDescription, reqVO.getTrainingDescription())
                .betweenIfPresent(ResumeTrainingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ResumeTrainingDO::getId));
    }

}